package com.somewater.storage
{
	import flash.system.ApplicationDomain;

	public class Lib
	{
		public function Lib()
		{
		}
		
		
		public static function getMc(name:String, library:String = "ui", instance:Boolean = true):*
		{
			if(ApplicationDomain.currentDomain.hasDefinition("balance." + name))
			{
				var cl:Class = ApplicationDomain.currentDomain.getDefinition("balance." + name) as Class;
				if(instance)
					return new cl();
				else
					return cl;
			}
			
			throw new Error("Undefined asset name " + name);
		}
	}
}